package com.bling.common.bean;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * 表单字段
 * @author BLingSoft
 *
 */
@Entity
@Table(name="T_FIELD")
public class Field implements Serializable {

	private static final long serialVersionUID = -4987074221940708121L;
	
	private Integer id; // 主键
	private String name; // 字段名称
	private String value; // 字段值 ：可传递给校验框架进行校验作用
	private boolean isradio; //是否单选按钮
	private String defaultvalue;//默认值：单选按钮默认值采用“_”链接
	private String promp; // 字段提示信息
	private Integer length; // 字段长度
	private Integer maxlength; // 字段最大长度
	private Integer minlength; // 字段最小长度
	private boolean isnumber; // 是否数字 0 不是数字 1 是数字
	private boolean isemail; //是否邮箱 0 不是邮箱 1 是邮箱
	private String nullerror; // 为空时错误提示信息
	private String syntaxerror; // 输入有误时提示信息
	private Integer sort; // 字段排序
	
	public Field() {
		super();
	}
	public Field(String name, String value, boolean isradio,
			String defaultvalue, String promp, Integer length,
			Integer maxlength, Integer minlength, boolean isnumber,
			boolean isemail, String nullerror, String syntaxerror, Integer sort) {
		super();
		this.name = name;
		this.value = value;
		this.isradio = isradio;
		this.defaultvalue = defaultvalue;
		this.promp = promp;
		this.length = length;
		this.maxlength = maxlength;
		this.minlength = minlength;
		this.isnumber = isnumber;
		this.isemail = isemail;
		this.nullerror = nullerror;
		this.syntaxerror = syntaxerror;
		this.sort = sort;
	}
	
	@Id
	@GeneratedValue
	@Column
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(length=50)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(length=50)
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	
	@Column
	public boolean getIsradio() {
		return isradio;
	}
	public void setIsradio(boolean isradio) {
		this.isradio = isradio;
	}
	
	@Column(length=150)
	public String getDefaultvalue() {
		return defaultvalue;
	}
	public void setDefaultvalue(String defaultvalue) {
		this.defaultvalue = defaultvalue;
	}
	
	@Column(length=50)
	public String getPromp() {
		return promp;
	}
	public void setPromp(String promp) {
		this.promp = promp;
	}
	
	@Column
	public Integer getLength() {
		return length;
	}
	public void setLength(Integer length) {
		this.length = length;
	}
	
	@Column
	public Integer getMaxlength() {
		return maxlength;
	}
	public void setMaxlength(Integer maxlength) {
		this.maxlength = maxlength;
	}
	
	@Column
	public Integer getMinlength() {
		return minlength;
	}
	public void setMinlength(Integer minlength) {
		this.minlength = minlength;
	}
	
	@Column
	public boolean getIsnumber() {
		return isnumber;
	}
	public void setIsnumber(boolean isnumber) {
		this.isnumber = isnumber;
	}
	
	@Column
	public boolean getIsemail() {
		return isemail;
	}
	public void setIsemail(boolean isemail) {
		this.isemail = isemail;
	}
	
	@Column(length=50)
	public String getNullerror() {
		return nullerror;
	}
	public void setNullerror(String nullerror) {
		this.nullerror = nullerror;
	}
	
	@Column(length=50)
	public String getSyntaxerror() {
		return syntaxerror;
	}
	public void setSyntaxerror(String syntaxerror) {
		this.syntaxerror = syntaxerror;
	}
	
	@Column
	public Integer getSort() {
		return sort;
	}
	public void setSort(Integer sort) {
		this.sort = sort;
	}
}
